package com.di.base.feign.service.impl;

import com.di.base.common.dto.AccountRequestDTO;
import com.di.base.common.exception.BusinessException;
import com.di.base.feign.AccountFeignClient;
import com.di.base.feign.service.AccountFeignService;
import feign.FeignException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("accountFeignService")
public class AccountFeignServiceImpl implements AccountFeignService {

    @Resource
    private AccountFeignClient accountFeignClient;

    @Override
    public void decrease(AccountRequestDTO request) {
        try {
            accountFeignClient.decrease(request);
        } catch (FeignException e) {
            throw e;
        }
    }

    @Override
    public void increase(AccountRequestDTO request) {
        try {
            accountFeignClient.increase(request);
        } catch (FeignException e) {
            throw e;
        }
    }
}